//
// Copyright (c) 2009 All Right Reserved
//
// vl
//
// 2009-01-01
// Contains ...
using System;
using LargoCommon.Interfaces;
using LargoCommon.Music;
namespace LargoCommon.Composer
{
///
/// Musical Engine.
///
[Serializable]
public sealed class LineRules : ILineRules
{
#region Public properties
///
/// Gets RuleToneHarmonic.
///
/// Property description.
public float RuleToneHarmonic { get; private set; }
///
/// Gets RuleMelodicFigural.
///
/// Property description.
public float RuleMelodicFigural { get; private set; }
///
/// Gets RuleMelodicVariability.
///
/// General musical property.
public float RuleMelodicVariability { get; private set; }
///
/// Gets RuleBreakingLine.
///
/// Property description.
public MelodicShape MelodicShape { get; private set; }
///
/// Gets RuleIntervalEasySing.
///
/// General musical property.
public float RuleIntervalEasySing { get; private set; }
#endregion
#region Public static methods
///
/// New Standard Line Rules.
///
/// The status.
///
/// Returns value.
///
public static LineRules NewStandardLineRules(LineStatus status) {
var lr = new LineRules();
if (status == null) {
return null;
}
lr.RuleIntervalEasySing = 1.0f;
if (status.IsHarmonic) {
lr.RuleToneHarmonic = 1.0f;
if (status.IsHarmonicBass) {
//// lr.RuleToneRoot = 1.0f;
}
}
//// if (status.HasMelodicMotive) {
lr.RuleMelodicFigural = 1.0f;
//// }
lr.MelodicShape = status.MelodicShape;
if (!status.IsFilling) {
lr.RuleMelodicVariability = 1.0f;
}
return lr;
}
#endregion
}
}